package com.hm_.config;


import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ErrorHandle {
	@ExceptionHandler(Exception.class)
	@ResponseBody
	public Object handleAll(Exception e) {
		return "赶紧给项目经理打电话, 你个哈麻批,天亮噶多!"+e.getClass();
	}
	
	@ExceptionHandler(NullPointerException.class)
//	@ResponseBody
	public String handleNullPointerException(Exception e,Model model) {
		model.addAttribute("e",e);
		return "error/null";
	}
}
